<?php namespace Home\Controller;
use Common\Model\Commod;
use Hdphp\Controller\Controller;

class PriceController extends Controller{
    public function index(){
        if(Q('post.search')){
            $seaname=Q('post.search');
            $commodModel=new Commod();
            $sousuoData=$commodModel->where("coname like '%{$seaname}%'")->get();
        }elseif(Q('get.bid')){
            $bid=Q('get.bid');
            $commodModel=new Commod();
            $sousuoData=$commodModel->where("shop_brand_bid={$bid}")->get();
        }else{
            $commodModel=new Commod();
            $pril=Q('get.pril');
            $prir=Q('get.prir');
            $sousuoData=$commodModel->whereBetween('comallpr',[$pril,$prir])->limit(10)->get();
            View::with('pril',$pril);
            View::with('prir',$prir);
        }
        View::with('sousuoData',$sousuoData);
        View::make();
    }
}